package ai.people.netmon.framework.domain.common.monitor;

import ai.people.netmon.framework.businessenum.AnalysisSourceEnum;
import ai.people.netmon.framework.domain.ethereum.monitor.entity.EthereumUsers;
import ai.people.netmon.framework.domain.facebook.view.entity.FacebookAccountView;
import ai.people.netmon.framework.domain.reddit.monitor.entity.RedditUsers;
import ai.people.netmon.framework.domain.twitter.view.entity.TwitterAccountView;
import ai.people.netmon.framework.domain.weibo.monitor.entity.WeiboUsers;
import ai.people.netmon.framework.domain.whatsapp.monitor.entity.WhatsappUsers;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 *  用户信息vo-cockroachdb
 * </p>
 *
 * @author zhenglin
 * @since 2022-03-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
public class MonitorUsersListVO {
    /**
     * 账号id
     */
    private String id;
    /**
     * 账号类型
     */
    private String analysisSource;
    /**
     * 头像链接
     */
    private String avatar;
    /**
     * 名
     */
    private String firstName;
    /**
     * 姓
     */
    private String lastName;
    /**
     * 账号
     */
    private String username;
    /***
     * 群组数量
     */
    private Integer groupCount;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 地址
     */
    private String location;
    /**
     * 标签
     */
    private String tags;
    /**
     * 加入分析状态
     */
    private Boolean joinStatus;

    public MonitorUsersListVO(FacebookAccountView one) {
        this.id = one.getAccountId();
        this.analysisSource = AnalysisSourceEnum.facebook.name();
        this.avatar = one.getHeaderPicture();
        this.firstName = null;
        this.lastName = null;
        this.username = one.getAccountName();
        this.groupCount = null;
        this.phone = one.getFormattedPhoneNumber();
        this.location = one.getAddress();
        this.tags = null;
        this.joinStatus = null;
    }

    public MonitorUsersListVO(TwitterAccountView one) {
        this.id = one.getAccountId();
        this.analysisSource = AnalysisSourceEnum.twitter.name();
        this.avatar = one.getHeaderPicture();
        this.firstName = null;
        this.lastName = null;
        this.username = one.getAccountName();
        this.groupCount = null;
        this.phone = one.getFormattedPhoneNumber();
        this.location = one.getAddress();
        this.tags = null;
        this.joinStatus = null;
    }

    public MonitorUsersListVO(RedditUsers one) {
        this.id = one.getUserId();
        this.analysisSource = AnalysisSourceEnum.reddit.name();
        this.avatar = one.getHeaderImage();
        this.firstName = null;
        this.lastName = null;
        this.username = one.getUserName();
        this.groupCount = null;
        this.phone = null;
        this.location = null;
        this.tags = null;
        this.joinStatus = null;
    }

    public MonitorUsersListVO(EthereumUsers one) {
        this.id = one.getId();
        this.analysisSource = AnalysisSourceEnum.ethereum.name();
        this.avatar = null;
        this.firstName = null;
        this.lastName = null;
        this.username = one.getName();
        this.groupCount = null;
        this.phone = null;
        this.location = null;
        this.tags = null;
        this.joinStatus = null;
    }

    public MonitorUsersListVO(WeiboUsers one) {
        this.id = String.valueOf(one.getUserId());
        this.analysisSource = AnalysisSourceEnum.weibo.name();
        this.avatar = null;
        this.firstName = null;
        this.lastName = null;
        this.username = one.getName();
        this.groupCount = null;
        this.phone = null;
        this.location = null;
        this.tags = null;
        this.joinStatus = null;
    }

    public MonitorUsersListVO(WhatsappUsers one) {
        this.id = one.getId();
        this.analysisSource = AnalysisSourceEnum.whatsapp.name();
        this.avatar = null;
        this.firstName = null;
        this.lastName = null;
        this.username = one.getName();
        this.groupCount = null;
        this.phone = null;
        this.location = null;
        this.tags = null;
        this.joinStatus = null;
    }
}
